package com.example.a_java.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * 还款计划实体类
 */
@Data
@TableName("repayment_plan")
@Schema(description = "还款计划")
public class RepaymentPlan {

    /**
     * 主键ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    @Schema(description = "主键ID")
    private Long id;

    /**
     * 合同ID
     */
    @Schema(description = "合同ID")
    private Long contractId;

    /**
     * 合同编号
     */
    @Schema(description = "合同编号")
    private String contractNo;

    /**
     * 贷款ID
     */
    @Schema(description = "贷款ID")
    private Long loanId;

    /**
     * 贷款编号
     */
    @Schema(description = "贷款编号")
    private String loanNo;

    /**
     * 客户ID
     */
    @Schema(description = "客户ID")
    private Long customerId;

    /**
     * 客户姓名
     */
    @Schema(description = "客户姓名")
    private String customerName;

    /**
     * 贷款金额
     */
    @Schema(description = "贷款金额")
    private BigDecimal loanAmount;

    /**
     * 贷款期限(月)
     */
    @Schema(description = "贷款期限(月)")
    private Integer loanTerm;

    /**
     * 年利率(%)
     */
    @Schema(description = "年利率(%)")
    private BigDecimal interestRate;

    /**
     * 还款方式
     */
    @Schema(description = "还款方式")
    private String repaymentMethod;

    /**
     * 开始日期
     */
    @Schema(description = "开始日期")
    private LocalDate startDate;

    /**
     * 结束日期
     */
    @Schema(description = "结束日期")
    private LocalDate endDate;

    /**
     * 总期数
     */
    @Schema(description = "总期数")
    private Integer totalPeriods;

    /**
     * 已还期数
     */
    @Schema(description = "已还期数")
    private Integer paidPeriods;

    /**
     * 总利息
     */
    @Schema(description = "总利息")
    private BigDecimal totalInterest;

    /**
     * 总金额(本金+利息)
     */
    @Schema(description = "总金额(本金+利息)")
    private BigDecimal totalAmount;

    /**
     * 已还金额
     */
    @Schema(description = "已还金额")
    private BigDecimal paidAmount;

    /**
     * 剩余金额
     */
    @Schema(description = "剩余金额")
    private BigDecimal remainingAmount;

    /**
     * 下次还款日期
     */
    @Schema(description = "下次还款日期")
    private LocalDate nextRepayDate;

    /**
     * 下次还款金额
     */
    @Schema(description = "下次还款金额")
    private BigDecimal nextRepayAmount;

    /**
     * A状态：1-正常, 2-结清, 3-逾期
     */
    @Schema(description = "状态：1-正常, 2-结清, 3-逾期")
    private Integer status;

    /**
     * 创建人
     */
    @Schema(description = "创建人")
    private String createBy;

    /**
     * 创建时间
     */
    @Schema(description = "创建时间")
    private LocalDateTime createTime;

    /**
     * 更新人
     */
    @Schema(description = "更新人")
    private String updateBy;

    /**
     * 更新时间
     */
    @Schema(description = "更新时间")
    private LocalDateTime updateTime;

    /**
     * 备注
     */
    @Schema(description = "备注")
    private String remark;
} 